import api from './index'

// 获取随机菜品
export const getRandomFood = () => {
  return api.get('/foods/random')
}

// 获取所有启用的菜品
export const getAllEnabledFoods = () => {
  return api.get('/foods/enabled')
}

// 根据分类获取菜品
export const getFoodsByCategory = (categoryId) => {
  return api.get(`/foods/category/${categoryId}`)
}

// 搜索菜品
export const searchFoods = (keyword) => {
  return api.get('/foods/search', { params: { keyword } })
}

// 获取菜品详情
export const getFoodById = (id) => {
  return api.get(`/foods/${id}`)
}